package io.xccit.security.util;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.xccit.model.system.SysUser;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * @author CH_ywx
 * @date 2023-06-27
 * @description 用户信息封装类
 */
@ApiModel(description = "用户信息封装类")
public class CustomUserDetail extends User {

    @ApiModelProperty("用户信息")
    private SysUser sysUser;

    public CustomUserDetail(SysUser sysUser , Collection<? extends GrantedAuthority> authorities) {
        super(sysUser.getUsername(),sysUser.getPassword(),authorities);
        this.sysUser = sysUser;
    }

    public SysUser getSysUser() {
        return sysUser;
    }

    public void setSysUser(SysUser sysUser) {
        this.sysUser = sysUser;
    }
}
